function bciLoadClassifier(fileName)
% bciLoadClassifier(fileName)
% reads a trained classifier from fileName (absolute or relative pathname) 
% into global bci structure (use feedback runs to load a former classifier)
% Note, that most parameters must be identical.
% you can also directly put the bci struct as argument

global GLOBALbci;

if isstruct(fileName),
    bci = fileName;
else
    load(fileName);
end

if isfield(bci,'LogReg'),
    GLOBALbci.LogReg=bci.LogReg;
end    
if isfield(bci,'movdirSVM'),
    GLOBALbci.movdirSVM=bci.movdirSVM;
end    
if isfield(bci,'cspOvsOmask'),
    GLOBALbci.cspOvsOmask=bci.cspOvsOmask;
end    
if isfield(bci,'featureMask'),
     GLOBALbci.featureMask=bci.featureMask;
 end    
if isfield(bci,'multiSVM'),
    GLOBALbci.multiSVM=bci.multiSVM;
end    
if isfield(bci,'cspW'),
    GLOBALbci.cspW=bci.cspW;
end    
if isfield(bci,'normScale'),
    GLOBALbci.normScale=bci.normScale;
end    
if isfield(bci,'trainScale'),
    GLOBALbci.trainScale=bci.trainScale;
end    
if isfield(bci,'trainMean'),
    GLOBALbci.trainMean=bci.trainMean;
end    
if isfield(bci,'reshape'),
    GLOBALbci.reshape=bci.reshape;
end    
if isfield(bci,'goodChan'),
    GLOBALbci.goodChan=bci.goodChan;
end    
if isfield(bci,'init')&&isfield(bci.init,'featOfInterest'),
    GLOBALbci.init.featOfInterest = bci.init.featOfInterest;
end
if isfield(bci,'selectedFeat'),
    GLOBALbci.selectedFeat = bci.selectedFeat;
end
